/*
 * @Author: szx
 * @Date: 2023-01-27 05:11:44
 * @LastEditTime: 2023-04-17 14:57:22
 * @Description:
 * @FilePath: \learn\fullstackopen\part6\redux-anecdotes-main\src\components\Notification.jsx
 */
import { useSelector } from 'react-redux';

const Notification = () => {
    const notification = useSelector((state) => state.notification);
    const style = {
        border: 'solid',
        padding: 10,
        borderWidth: 1
    };
    return notification.length > 0 && <div style={style}>{notification}</div>;
};

export default Notification;
